<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--输出hello-->
<p th:text="${hello}"></p>

<!--form表单-->
<form th:action="@{/thymeleaf/hello}">
    <input th:type="text" th:name="id">
    <button>提交</button>
</form>

<!--each遍历-->
<table cellspacing="0" cellpadding="0" border="1" width="500px">
    <caption align="center">花名册</caption>
    <tr>
        <th>序号</th>
        <th>id</th>
        <th>姓名</th>
        <th>年龄</th>
    </tr>
    <tr align="center" th:each="user,userstate:${users}">
        <td th:text="${userstate.index+1}"></td>
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.age}"></td>
    </tr>
</table>

<!--map遍历-->
<div th:each="map,mapstate:${map}">
    <div th:text="${map}"></div>
    key:<span th:text="${mapstate.current.key}"></span><br>
    value:<span th:text="${mapstate.current.value}"></span><br>
    ============================
</div>

<!--数组输出-->
<div th:each="name,namestate:${names}">
    序号:<span th:text="${namestate.count}"></span>
    姓名:<span th:text="${name}"></span>
</div>

<!--日期输出-->
<div>
    <span th:text="${now}"></span><br>
    <span th:text="${#dates.format(now,'yyyy-MM-dd hh:mm:ss')}"></span>
</div>

<!--if判断-->
<div>
    <span th:if="${age>20}" th:text="你终于长大了"></span>
</div>

<!--引入模块-->
<div th:include="foot::copy" style="color: red;font-size: 20px" align="center"></div>

</body>
</html>